<template>
	<popupVue v-if="isShow" mode="bottom" @click="onDismiss">
		<view class="wrap-explain-popup safe-area flex column" @click.stop.prevent>
			<view class="explain-popup-title flex align-center just-center">
				权益说明
			</view>
			
			<scroll-view scroll-y class="popup-content">
				<rich-text :nodes="content"></rich-text>
			</scroll-view>
			
			<image
				class="explain-close"
				@click="onDismiss()"
				:src="$staticImagePath('vip/explain_close.png')"
			/>
		</view>
	</popupVue>
</template>

<script>
	import popupVue from "../popup/popup.vue";
	
	export default {
		components: {
			popupVue
		},
		props: {
			/**
			 * 是否显示
			 */
			isShow: {
				type: Boolean,
				default: false,
			},
			/**
			 * 权益
			 */
			content: {
				type: String,
				default: "",
			}
		},
		methods: {
			/**
			 * 关闭
			 */
			onDismiss() {
				this.$emit("update:isShow", false);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.wrap-explain-popup {
		width: 100vw;
		height: 60vh;
		background-color: white;
		border-top-left-radius: 20rpx;
		border-top-right-radius: 20rpx;
		padding: 15rpx 35rpx;
		box-sizing: border-box;
		overflow: hidden;
		position: relative;
		
		.explain-popup-title {
			width: 100%;
			height: 122rpx;
			overflow: hidden;
			border-bottom: 2rpx solid #D8D8D8;
			color: #3D3D3D;
			font-size: 36rpx;
			font-weight: bold;
		}
		
		.popup-content {
			margin-top: 40rpx;
			width: 100%;
			flex: 1;
			overflow: hidden;
		}
		
		.explain-close {
			position: absolute;
			right: 42rpx;
			top: 47rpx;
			width: 34rpx;
			height: 34rpx;
		}
	}
</style>